# #异常捕获
# try:
#     print("try...")
#     r = 10 / 0
#     print("result:", r)
# except ZeroDivisionError as e:
#     print("except:", e)
# finally:
#     print("finally...")
# print("END")
#
# #捕获多个异常
# #1.使用元组
# try:
#     print("try...")
#     r = 10 / int('a')
#     print("result:", r)
# except (ValueError, ZeroDivisionError) as e:
#     print("except:", e)
#
# #2.使用多个except
# try:
#     print("try...")
#     r = 10 / int('a')
#     print("result:", r)
# except ValueError as e:
#     print("ValueError:", e)
# except ZeroDivisionError as e:
#     print("ZeroDivisionError:", e)
# else:
#     print("no error!")
# finally:
#     print("finally...")
# print("END")
#
# #捕获所有异常
# try:
#     print("try...")
#     r = 10 / int('a')
#     print("result:", r)
# except Exception as e:
#     print("except:", e)
# finally:
#     print("finally...")
# print("END")
#
# #else
# try:
#     print('try...')
#     r = 10 / int('2')
#     print('result:', r)
# except Exception as e:
#     print('ValueError:', e)
# else:
#     print('no error!')
#
# #finally
# try:
#     print('try...')
#     r = 10 / int('2')
#     print('result:', r)
# except Exception as e:
#     print('ValueError:', e)
# finally:
#     print('finally...')
# print('END')

#导入模块: import 模块名
import time
time.sleep(5)

#导入特定模块: from 模块名 import 功能名
from time import sleep
sleep(5)

#导入模块中所有功能: from 模块名 import *
from time import *
sleep(5) #不需要time.sleep

#模块别名: import 模块名 as 别名
import time as t
t.sleep(5)